﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace QuanLyDuocPham.View.QuanLyHeThong.DanhMuc
{
    /// <summary>
    /// Interaction logic for HOATCHAT_Edit_View.xaml
    /// </summary>
    public partial class HOATCHAT_Edit_View : Window
    {
        public HOATCHAT_Edit_View()
        {
            InitializeComponent();
        }
        public delegate void added();
        public added done;

        string ma_hoatchat;


        public string _ma_hoatchat
        {
            set
            {
                ma_hoatchat = value;
            }
        }
        Controllers.QuanLyHeThong.DanhMuc.HOATCHAT_Control hoatchatctrl = new Controllers.QuanLyHeThong.DanhMuc.HOATCHAT_Control();
        private void btBack_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            
                hoatchatctrl.updateData(ma_hoatchat, txtTenHoatChat, chbTheo_Toa, txtGhi_Chu, txtMoTa);
                if (done != null)
                {
                    done();
                }
            
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            hoatchatctrl.loadForm_Edit(ma_hoatchat,  txtTenHoatChat, chbTheo_Toa, txtGhi_Chu, txtMoTa);
        }
    }
}
